﻿using System;
using System.ComponentModel.DataAnnotations;

namespace GioHangViet.Models
{
    [Table("News")]
    public class News
    {
        [Key]
        [Required(ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewAlias")]
        [StringLength(200, ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewAliasLength")]
        [Display( ResourceType = typeof(Resources.Displaies),Name = "DisplayNewsAlias")]
        public string Alias { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewTitle")]
        [StringLength(200, ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewTitleLength")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayNewsTitle")]
        public string Title { get; set; }
        
        [StringLength(20, ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewThumbnailLength")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayNewsThumbnail")]
        public string Thumbnail { get; set; }
        
        [Required(ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewDescription")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayNewsDiscription")]
        public string Description { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewCreateDate")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayNewsCreateDate")]
        public DateTime CreateDate { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewPublicDate")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayNewsPublicDate")]
        public DateTime PublicDate { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorNewCreateBy")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayProductCreateBy")]
        public string CreateBy { get; set; }
    }
}